The invention refers to implantable pacemakers as those described in European application No. EP-A2-0 089 014 (and corresponding copending U.S. application Ser. No. 06/474,241 in the name of the same applicants) wherein the stimulation/inhibition rate of the pacemaker depends, by a programmable algorithm, on the respiratory rate of the patient, detected through the measurement of the impedances of a subcutaneous part of the patient's chest. Said European application No. EP-A2-0 089 014, and its U.S. counterpart, concerns a unit that extracts a clean signal, e.g. a squared one, from the signal coming from the body impedance variation detecting unit. Said clean signal shows a transition every time that the input signal exceeds a fixed and preferably programmable value. In the structural arrangement of the unit, the suggested solution allows to detect the amplitude variations of the input signal only if said variations are positive in comparison with the base line. The same unit is then able to detect only slow variations of the base impedance. Hospital practice has shown that in some cases the variations of the input signal amplitude of said unit can be both positive and negative with regard to the base line. The present invention relates to a new signal extracting unit for pacemakers, of the type above mentioned, capable to meet said needs and to produce a clean output signal, e.g. a squared one, that shows a transition every time that the difference between a minimum value and a maximum value or a maximum value and a minimum value of the input signal exceeds a fixed and preferably programmable value. Moreover the unit according to the invention is able to perform both slow and fast and recurrent variations of the base line. In consideration of the fact that such a signal extracting unit has proved to be very useful and reliable, the invention proposes further an alternative structural arrangement of the same unit to make it suitable to be assembled in physiologic pacemakers as those described in the Italian patent application No. 12421 A/84 of Feb. 7, 1984 by the same applicants, and corresponding copending U.S. application Ser. No. 06/659,542, wherein the stimulation/inhibition rate depends, by a special programmable algorithm, on the patient's pulmonary minute ventilation (1/min).